package com.ruoyi.points.domain;

import java.time.LocalDate;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 积分变动记录对象 points_change_record
 * 
 * @author 区嘉盛
 * @date 2025-06-17
 */
@Schema(description = "积分变动记录对象")
public class PointsChangeRecord extends BaseEntity
{
    private static final long serialVersionUID = 1L;


    /** 自增ID */
    @Schema(title = "自增ID")
    @Excel(name = "自增ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    /** 逻辑主键-记录编码 */
    @Schema(title = "逻辑主键-记录编码")
    private String recordCode;

    /** 用户ID */
    @Schema(title = "用户ID")
    @Excel(name = "用户ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long userId;

    /** 积分变动数量(正数为增加，负数为减少) */
    @Schema(title = "积分变动数量(正数为增加，负数为减少)")
    @Excel(name = "积分变动数量(正数为增加，负数为减少)")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long pointsChange;

    /** 变动前积分余额 */
    @Schema(title = "变动前积分余额")
    @Excel(name = "变动前积分余额")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long pointsBefore;

    /** 变动后积分余额 */
    @Schema(title = "变动后积分余额")
    @Excel(name = "变动后积分余额")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long pointsAfter;

    /** 变动来源类型 1-答题奖励 2-发帖奖励 3-帖子获赞 4-帖子被收藏 5-发评论奖励 6-评论获赞 7-商品兑换 8-系统调整 9-活动奖励 10-签到奖励 */
    @Schema(title = "变动来源类型 1-答题奖励 2-发帖奖励 3-帖子获赞 4-帖子被收藏 5-发评论奖励 6-评论获赞 7-商品兑换 8-系统调整 9-活动奖励 10-签到奖励")
    @Excel(name = "变动来源类型 1-答题奖励 2-发帖奖励 3-帖子获赞 4-帖子被收藏 5-发评论奖励 6-评论获赞 7-商品兑换 8-系统调整 9-活动奖励 10-签到奖励")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long changeSourceType;

    /** 批次编码 */
    @Schema(title = "批次编码")
    @Excel(name = "批次编码")
    private String batchCode;

    /** 创建人 */
    @Schema(title = "创建人")
    private String createdBy;

    /** 创建时间 */
    @Schema(title = "创建时间")
    private LocalDate createdTime;

    /** 更新人 */
    @Schema(title = "更新人")
    private String updatedBy;

    /** 更新时间 */
    @Schema(title = "更新时间")
    private LocalDate updatedTime;

    /** 删除标志 0-未删除 1-已删除 */
    @Schema(title = "删除标志 0-未删除 1-已删除")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long deletedFlag;
    public void setId(Long id) 
    {
        this.id = id;
    }
    public Long getId() 
    {
        return id;
    }

    public void setRecordCode(String recordCode) 
    {
        this.recordCode = recordCode;
    }

    public String getRecordCode() 
    {
        return recordCode;
    }


    public void setUserId(Long userId) 
    {
        this.userId = userId;
    }

    public Long getUserId() 
    {
        return userId;
    }


    public void setPointsChange(Long pointsChange) 
    {
        this.pointsChange = pointsChange;
    }

    public Long getPointsChange() 
    {
        return pointsChange;
    }


    public void setPointsBefore(Long pointsBefore) 
    {
        this.pointsBefore = pointsBefore;
    }

    public Long getPointsBefore() 
    {
        return pointsBefore;
    }


    public void setPointsAfter(Long pointsAfter) 
    {
        this.pointsAfter = pointsAfter;
    }

    public Long getPointsAfter() 
    {
        return pointsAfter;
    }


    public void setChangeSourceType(Long changeSourceType) 
    {
        this.changeSourceType = changeSourceType;
    }

    public Long getChangeSourceType() 
    {
        return changeSourceType;
    }


    public void setBatchCode(String batchCode) 
    {
        this.batchCode = batchCode;
    }

    public String getBatchCode() 
    {
        return batchCode;
    }


    public void setCreatedBy(String createdBy) 
    {
        this.createdBy = createdBy;
    }

    public String getCreatedBy() 
    {
        return createdBy;
    }


    public void setCreatedTime(LocalDate createdTime) 
    {
        this.createdTime = createdTime;
    }

    public LocalDate getCreatedTime() 
    {
        return createdTime;
    }


    public void setUpdatedBy(String updatedBy) 
    {
        this.updatedBy = updatedBy;
    }

    public String getUpdatedBy() 
    {
        return updatedBy;
    }


    public void setUpdatedTime(LocalDate updatedTime) 
    {
        this.updatedTime = updatedTime;
    }

    public LocalDate getUpdatedTime() 
    {
        return updatedTime;
    }


    public void setDeletedFlag(Long deletedFlag) 
    {
        this.deletedFlag = deletedFlag;
    }

    public Long getDeletedFlag() 
    {
        return deletedFlag;
    }



    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("recordCode", getRecordCode())
            .append("userId", getUserId())
            .append("pointsChange", getPointsChange())
            .append("pointsBefore", getPointsBefore())
            .append("pointsAfter", getPointsAfter())
            .append("changeSourceType", getChangeSourceType())
            .append("batchCode", getBatchCode())
            .append("createdBy", getCreatedBy())
            .append("createdTime", getCreatedTime())
            .append("updatedBy", getUpdatedBy())
            .append("updatedTime", getUpdatedTime())
            .append("deletedFlag", getDeletedFlag())
            .toString();
    }
}
